#include <system.h>

/*
Read byte from I/O port.
Ref: Bran's Kernel Dev Tutorial: http://osdever.net/bkerndev/
*/
unsigned char inportb(unsigned short _port)
{
	unsigned char rv;
	__asm__ __volatile__ ("inb %1, %0" : "=a"(rv) : "dN" (_port));
	return rv;
}

/*
Write byte to I/O port.
Ref: Bran's Kernel Dev Tutorial: http://osdever.net/bkerndev/
*/
void outportb(unsigned short _port, unsigned char _data)
{
	__asm__ __volatile__ ("outb %1, %0" : : "dN" (_port), "a" (_data));
}
